package com.suixinsanren.algorithm.sort.bubble.demo01;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

import java.util.Arrays;
import java.util.Random;

public class BubbleTestDrive {

    private final int[] arr = new int[10];
    private final Random random = new Random();

//    @Before
    public void init() {
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextInt(10);
        }
        System.out.println(Arrays.toString(arr));
    }

    @Test
    public void eachTest(){
        for (int i = 0; i < 20; i++) {
            init();
            testSort();
            printArr();
        }
    }

    @Test
    public void testSort() {
        BubbleSort01.sort(arr);
    }

//    @After
    public void printArr(){
        System.out.println(Arrays.toString(arr));
        System.out.println("----------------------------------------");
    }



}
